Dim iconfilename$ 'The filename of the icon file(.EXE, .DLL, .ICO)
Dim numicons% 'The number of icons in a file
Declare Function DrawIcon Lib "user" (ByVal hDC As Integer, ByVal x As Integer, ByVal Y As Integer, ByVal hIcon As Integer) As Integer
'hDC- Device context of the control to be drawn to
'x, y- coordinates of where to draw the icon in the control
'hIcon-Handle of an icon
Declare Function ExtractIcon Lib "shell.dll" (ByVal hinst%, ByVal lpszExeName$, ByVal iIcon%) As Integer
'hinst- The instance handle of the application calling ExtractIcon. Should be the name of your EXE file, or VB.EXE at runtime
'lpszExeName- Module containing icons
'iIcon%- number of the icon in the file. If you put -1 for this, it returns the amount of icons in a file
'The return value should be: 1)An icon handle 2)1 if it's not a EXE, DLL, or ICO file 3)NULL if no icons are in a file
Declare Function GetModuleHandle Lib "Kernel" (ByVal lpModuleName As String) As Integer
'lpModuleName- The filename of a module, to get the handle of it.
Sub AboutProg ()
End Sub
Sub btnAbout_Click ()
nl$ = Chr$(13) + Chr$(10)
Msg$ = "Icon Extract, Written By Tim Hill (AOL: Tim112)" + nl$ + "Feel free to use this code in your programs." + nl$ + "Tim Hill shall not be responsible in any way for any type of damages incurred to you or your system during the use of this software."
MsgBox Msg$, 64, "Icon Extract"
End Sub
Sub btnCopy_Click ()
pic2.Picture = pic.Image 'Must be pic2.Picture = pic.IMAGE, not pic.Picture, because it is not
'actually part of the picture yet when you use the API call
End Sub
Sub btnOpen_Click ()
iconfilename$ = InputBox$("Icon File(.ICO,.EXE,.DLL):", "Icon Extract", "PROGMAN.EXE")'Asks for filename